package com.designPattern.FactoryMode;

/**
 * Created by Administrator on 2018/1/2.
 */

public class AllOperation {
}

class OperationAdd extends Operation {

    @Override
    public double operation() {
        return getNum1() + getNum2();
    }
}

class OperationSub extends Operation {

    @Override
    public double operation() {
        return getNum1() - getNum2();
    }
}

class OperationMul extends Operation {

    @Override
    public double operation() {
        return getNum1() * getNum2();
    }
}

class OperationDiv extends Operation {

    @Override
    public double operation() {
        return getNum1() / getNum2();
    }
}
